/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
package com.liferay.analystest;

import com.liferay.analystest.controller.MainWindowController;
import com.liferay.analystest.util.ErrorUtil;

import java.awt.EventQueue;

import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

/**
 *
 * @author Dante Wang
 */
public class Main {

	/**
	 * @param args the command line arguments
	 */
	public static void main(String args[]) {
		try {
			for (UIManager.LookAndFeelInfo info :
					UIManager.getInstalledLookAndFeels()) {

				if ("Metal".equals(info.getName())) {
					UIManager.setLookAndFeel(info.getClassName());
					break;
				}
			}
		}
		catch (ClassNotFoundException |
				InstantiationException |
				IllegalAccessException |
				UnsupportedLookAndFeelException e) {

			System.err.println("Error setting look and feel.");
		}

		// Create and display the form
		EventQueue.invokeLater(new Runnable() {

			@Override
			public void run() {
				try {
					new MainWindowController().MAINWINDOW.setVisible(true);
				}
				catch (Exception ex) {
					ErrorUtil.showErrorMessage(ex);
				}
			}
		});
	}
}
